﻿<%@ Page Language="C#" AutoEventWireup="true" validaterequest="false" CodeBehind="new.aspx.cs" Inherits="AnyOffice.general.email._new" %>

<%@ Register TagPrefix="fckeditorv2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>写邮件</title>
		
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<script src="/aspnet_client/core/function.js"></script>
		<script Language="JavaScript">
function  Trim(myvalue)
{
   return myvalue.replace(/(^\s*)|(\s*$)/g,"");
}

function CheckForm()
{
   if (document.Form1.ToId.value=="")
   { alert("请添加收件人！");
     return (false);
   }

   if (Trim(document.Form1.txtSubject.value)=="")
   {
   		if(!window.confirm("无邮件主题，是否发送邮件！"))
      	{
           document.Form1.txtSubject.focus();
           return (false);
        }
   }
   
   /*   
   var oEditor = FCKeditorAPI.GetInstance('txtContent');
   if(oEditor.GetHTML() == "")  
   { alert("邮件内容不能为空！");
     return (false);
   }
   */
   
 return true;
}

function CheckFile()
{
   if (document.Form1.fileAttach.value=="")
   { alert("请选择附件！");
     return (false);
   }   
   return true;	
}

function show_tr(tr_id, btn)
{
   var tr = document.getElementById(tr_id), str_hide="隐藏", str_add="添加";
   if(!tr)
      return;
   //alert(btn.innerText)
   if(tr.style.display=="none")
   {
      tr.style.display="";
      btn.innerText = str_hide+btn.innerText.substring(str_add.length,btn.innerText.length);
   }
   else
   {
      tr.style.display="none";
      btn.innerText = str_add+btn.innerText.substring(str_hide.length,btn.innerText.length);
   }
}
</script>
	</HEAD>
	<body class="bodycolor" topMargin="5">
		<form id="Form1" method="post" runat="server">
         <div class="main_div">
			<asp:Panel id="pnlMain" runat="server">
				<TABLE class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
					<TR>
						<TD class="tab_ti">
								写邮件
						</TD>
					</TR>
				</TABLE>				
				<TABLE width="85%" cellSpacing="0" cellPadding="0" border="0" class="tab_pub" align="center">
					<TR>
						<TD class="ta_bg" noWrap>收件人：</TD>
						<TD class="ta_txt">
							<asp:TextBox id="ToName" runat="server" TextMode="MultiLine" Rows="2" CssClass="BigStatic fl" Columns="55"
								ReadOnly="True"></asp:TextBox>
								<INPUT class="bnt_Add fl" title="添加收件人" onClick="user_select('ToId','ToName')" style="width:50px; display:inline-table;" type="button" value="添加" name="button">
								<INPUT class="bnt_Del fl" title="清空收件人" onClick="clear_double('ToId','ToName')" style="width:50px; display:inline-table;" type="button" value="清空" name="button">
								<INPUT id="ToId" type="hidden" name="ToId" runat="server">
								<div style="clear:both;"></div>
								<div style="height:20px;padding:5px 0px 2px 0px;"><a href="javascript:;" onClick="show_tr('tr_cc',this);">添加抄送</a> - <a href="javascript:;" onClick="show_tr('tr_bcc',this);">添加密送</a></div>
						</TD>
					</TR>
					<TR id="tr_cc" style="display:none;">
						<TD class="ta_bg" noWrap>抄送：</TD>
						<TD class="ta_txt">
							<asp:TextBox id="CopyToName" runat="server" TextMode="SingleLine" Rows="1" CssClass="BigStatic fl"
								Columns="50" ReadOnly="True"></asp:TextBox>
								<INPUT class="bnt_Add fl" title="添加抄送人" onClick="user_select('CopyToId','CopyToName')" type="button" value="添加"
								name="button"> <INPUT class="bnt_Del fl" title="清空抄送人" onClick="clear_double('CopyToId','CopyToName')" type="button" value="清空"
								name="button"> <INPUT id="CopyToId" type="hidden" name="CopyToId" runat="server">
						</TD>
					</TR>
					<TR id="tr_bcc" style="display:none;">
						<TD class="ta_bg" noWrap>密送：</TD>
						<TD class="ta_txt">
							<asp:TextBox id="SecretToName" runat="server" TextMode="SingleLine" Rows="1" CssClass="BigStatic fl"
								Columns="50" ReadOnly="True"></asp:TextBox>
								<INPUT class="bnt_Add fl" title="添加暗送人" onClick="user_select('SecretToId','SecretToName')" type="button" value="添加"
								name="button"> <INPUT class="bnt_Del fl" title="清空暗送人" onClick="clear_double('SecretToId','SecretToName')" type="button" value="清空"
								name="button"> <INPUT id="SecretToId" type="hidden" name="SecretToId" runat="server">
						</TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>邮件主题：</TD>
						<TD class="ta_txt">
							<asp:TextBox id="txtSubject" runat="server" CssClass="BigInput" Columns="50"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="ta_bg" vAlign="top" noWrap>邮件内容：</TD>
						<TD class="ta_txt">
							<FCKeditorV2:FCKeditor id="txtContent" runat="server" Width="100%" Height="300px" ToolbarSet="Basic"></FCKeditorV2:FCKeditor></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>附件：</TD>
						<TD class="ta_txt">
							<asp:Panel id="pnlAttach" runat="server" Visible="False">
								<asp:ListBox id="ltbFileList" CssClass="fl" runat="server" Rows="1"></asp:ListBox>
								<asp:button id="btnRemoveFile" runat="server" CssClass="bnt_Del fl" Text="删除" onclick="btnRemoveFile_Click"></asp:button>
							</asp:Panel></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>附件上传：</TD>
						<TD class="ta_txt"><INPUT class="SmallInput fl" id="fileAttach" type="file" size="26" name="fileAttach" runat="server">
							<asp:button id="btnAddFile" runat="server" CssClass="bnt_Add fl" Text="添加" Width="50" onclick="btnAddFile_Click"></asp:button></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>提醒：</TD>
						<TD class="ta_txt">
							<asp:CheckBox id="ckbSms" runat="server" Text="使用内部短信提醒收件人" Checked="True"></asp:CheckBox>
							<asp:CheckBox id="ckbMobile" runat="server" Visible="False" Text="使用手机短信提醒收件人"></asp:CheckBox></TD>
					</TR>
					<TR>
						<TD class="ta_bg" noWrap>重要程度：</TD>
						<TD class="ta_txt">
							<asp:RadioButtonList id="rblImportant" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
								<asp:ListItem Value="0" Selected="True">一般</asp:ListItem>
								<asp:ListItem Value="1">重要</asp:ListItem>
								<asp:ListItem Value="2">非常重要</asp:ListItem>
							</asp:RadioButtonList></TD>
					</TR>
					<TR align="center">
						<TD noWrap colSpan="2" class="bnt_con">
						     <table width="140" cellpadding="0" cellspacing="0" border="0" style="border:none;">
							   <tr>
							     <td style="border:none;"><asp:Button id="btnSend" runat="server" CssClass="bnt02 fl" Text="立即发送" Width="70" ToolTip="立即发送此邮件" onclick="btnSend_Click"></asp:Button></td>
								 <td style="border:none;"><INPUT class="bnt01 fr" title="清空所输入的内容，重新撰写" width="60" onClick="location='new.aspx'" type="button"
								value="重 填"></td>
							   </tr>
							 </table>
						</TD>
					</TR>
				</TABLE>
			</asp:Panel>
			<asp:Label id="lblMessage" runat="server"></asp:Label>
			<br>
			<br>
            </div>
		</form>
	</body>
</HTML>
